package com.jenkins.test.proxy.gov.context;

/**
 * @version V1.0.0
 * @ClassName: {@link GovRunContext}
 * @Description: GovRunContext
 * @author: Lanzhou
 * @date: 2022/1/22 13:33
 * @Copyright:2020 All rights reserved.
 */
public class GovRunContext {

    private static final ThreadLocal<GovRunContext> CONTEXT = ThreadLocal.withInitial(GovRunContext::new);

    /**
     * 企业编码
     */
    private String enterprise;

    /**
     * 调用标准名
     */
    private String standard;

    private GovRunContext() {
    }

    /**
     * 获取实例
     *
     * @return 返回
     */
    public static GovRunContext instance() {
        return CONTEXT.get();
    }

    public void clear() {
        // 只是清除我们的企业和运行信息, 缓存不清
        this.enterprise = null;
        this.standard = null;
        CONTEXT.remove();
    }


    public String getEnterprise() {
        return enterprise;
    }

    public void setEnterprise(String enterprise) {
        this.enterprise = enterprise;
    }

    public String getStandard() {
        return standard;
    }

    public void setStandard(String standard) {
        this.standard = standard;
    }

}
